﻿<script setup lang="ts" name="RichTextEditor">
import useScrollPosition from '@/hooks/scrollPosition'
import { storeToRefs } from 'pinia'
import { useSystemConfigStore } from '@/store/storage/systemConfigStore'
const route = useRoute()

const systemConfigStore = useSystemConfigStore()
const { systemConfig } = storeToRefs(systemConfigStore)

// 滚动行为
useScrollPosition(route)
const value = ref('hello world!')
const handleChange = (value: string) => {
  console.log(value)
}
</script>

<template>
  <el-space :size="systemConfig.space" fill direction="vertical">
    <el-card shadow="never" class="no-border no-radius">
      <Tinymce v-model="value" @change="handleChange" width="100%" />
    </el-card>
  </el-space>
</template>

<style scoped lang="scss">
.el-space {
  width: 100%;
  padding: var(--el-space) var(--el-space) 0;
}

.no-border {
  border: none;
}

.no-radius {
  border-radius: 0;
}

.el-card {
  display: flex;
  flex-direction: column;

  :deep(.el-card__header) {
    .card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;

    }
  }

  :deep(.el-card__body) {
    flex: 1;
  }
}
</style>
